import request from '@/utils/request'

// 查询分类管理列表
export function listCategoryManagement(query) {
  return request({
    url: '/basicData/categoryManagement/list',
    method: 'get',
    params: query
  })
}

// 查询分类管理详细
export function getCategoryManagement(categoryId) {
  return request({
    url: '/basicData/categoryManagement/' + categoryId,
    method: 'get'
  })
}

// 新增分类管理
export function addCategoryManagement(data) {
  return request({
    url: '/basicData/categoryManagement',
    method: 'post',
    data: data
  })
}

// 修改分类管理
export function updateCategoryManagement(data) {
  return request({
    url: '/basicData/categoryManagement',
    method: 'put',
    data: data
  })
}

// 删除分类管理
export function delCategoryManagement(categoryId) {
  return request({
    url: '/basicData/categoryManagement/' + categoryId,
    method: 'delete'
  })
}

//获取分类树
export function categoryTreeSelect(categoryManagement) {
  return request({
    url: '/basicData/categoryManagement/categoryTree',
    method: 'get',
    params: categoryManagement
  })
}
